package com.enjoy.concurrent.ch5;

import org.junit.Test;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class LinkedBlockingQueueTest {
    @Test
    public void test1(){
        BlockingQueue<String> blockingQueue = new LinkedBlockingQueue<>(3);
        blockingQueue.offer("aa");
        blockingQueue.offer("bb");
        blockingQueue.offer("cc");
        blockingQueue.offer("dd");

        System.out.println(blockingQueue.poll());
        System.out.println(blockingQueue.poll());
        System.out.println(blockingQueue.poll());
        System.out.println(blockingQueue.poll());

    }
}
